package com.pro.controller;

import com.pro.pojo.JsApplyRecord;
import com.pro.pojo.JsonData;
import com.pro.service.JsApplyRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName:JsApplyRecordController
 * Package:com.pro.controller
 * Description:
 *
 * @Date:2021/11/28 19:40
 * @Author: ZPT
 */
@RestController
@RequestMapping("/record")
public class JsApplyRecordController {
    @Autowired
    private JsApplyRecordService service;

    @RequestMapping("/getApplyRecord")
    public JsonData getApplyRecord(String position,String account,String fullName,String applyDate,Integer result){
        List<JsApplyRecord> recordList = service.getApplyRecord(position,account,fullName,applyDate,result);
        return recordList!=null?JsonData.buildSuccess(recordList):JsonData.buildError("服务端错误");
    }


    @RequestMapping("/updateApplyRecord")
    public JsonData updateApplyRecord(Integer id, Integer result, String remarks){
        Boolean aBoolean = service.updateApplyRecord(id, result, remarks);
        return aBoolean!=null?JsonData.buildSuccess(aBoolean):JsonData.buildError("服务端错误");
    }
}
